package com.yugao.fintech.draper.quartz.config;

import com.yugao.fintech.draper.quartz.scheduler.ScheduledJob;
import com.yugao.fintech.draper.quartz.service.ScheduledJobLogService;
import com.yugao.fintech.draper.quartz.support.QuartzJobExporter;
import com.yugao.fintech.draper.quartz.aspect.QuartzJobLogAspect;
import org.quartz.Scheduler;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
public class QuartzJobAutoConfig {

	@Bean
	public QuartzJobExporter quartzJobExporter() {
		return new QuartzJobExporter();
	}

	@Bean
	public ScheduledJob jobScheduler(Scheduler scheduler) {
		return new ScheduledJob(scheduler);
	}

	@Bean
	public QuartzJobLogAspect artJobLogAspect(ScheduledJobLogService scheduledJobLogService) {
		return new QuartzJobLogAspect(scheduledJobLogService);
	}
}
